<?php
	/**
	 * The abstract MyassetsGen class defined here is
	 * code-generated and contains all the basic CRUD-type functionality as well as
	 * basic methods to handle relationships and index-based loading.
	 *
	 * To use, you should use the Myassets subclass which
	 * extends this MyassetsGen class.
	 *
	 * Because subsequent re-code generations will overwrite any changes to this
	 * file, you should leave this file unaltered to prevent yourself from losing
	 * any information or code changes.  All customizations should be done by
	 * overriding existing or implementing new methods, properties and variables
	 * in the Myassets class.
	 * 
	 * @package My Application
	 * @subpackage GeneratedDataObjects
	 * @property-read integer $Id the value for intId (Read-Only PK)
	 * @property string $Asin the value for strAsin (Not Null)
	 * @property string $DetailPageURL the value for strDetailPageURL 
	 * @property string $Title the value for strTitle 
	 * @property string $ProductGroup the value for strProductGroup 
	 * @property string $ImageURL the value for strImageURL 
	 * @property string $Author the value for strAuthor 
	 * @property string $NumberOfPages the value for strNumberOfPages 
	 * @property string $Publisher the value for strPublisher 
	 * @property string $Isbn the value for strIsbn 
	 * @property string $Actor the value for strActor 
	 * @property string $Director the value for strDirector 
	 * @property string $RunningTime the value for strRunningTime 
	 * @property string $Artist the value for strArtist 
	 * @property string $Label the value for strLabel 
	 * @property string $NumberOfDiscs the value for strNumberOfDiscs 
	 * @property string $Tracks the value for strTracks 
	 * @property string $Language the value for strLanguage 
	 * @property string $Genre the value for strGenre 
	 * @property string $Owner the value for strOwner 
	 * @property-read boolean $__Restored whether or not this object was restored from the database (as opposed to created new)
	 */
	class MyassetsGen extends QBaseClass {

		///////////////////////////////////////////////////////////////////////
		// PROTECTED MEMBER VARIABLES and TEXT FIELD MAXLENGTHS (if applicable)
		///////////////////////////////////////////////////////////////////////
		
		/**
		 * Protected member variable that maps to the database PK Identity column myassets.id
		 * @var integer intId
		 */
		protected $intId;
		const IdDefault = null;


		/**
		 * Protected member variable that maps to the database column myassets.ASIN
		 * @var string strAsin
		 */
		protected $strAsin;
		const AsinMaxLength = 20;
		const AsinDefault = null;


		/**
		 * Protected member variable that maps to the database column myassets.DetailPageURL
		 * @var string strDetailPageURL
		 */
		protected $strDetailPageURL;
		const DetailPageURLDefault = null;


		/**
		 * Protected member variable that maps to the database column myassets.Title
		 * @var string strTitle
		 */
		protected $strTitle;
		const TitleDefault = null;


		/**
		 * Protected member variable that maps to the database column myassets.ProductGroup
		 * @var string strProductGroup
		 */
		protected $strProductGroup;
		const ProductGroupMaxLength = 20;
		const ProductGroupDefault = null;


		/**
		 * Protected member variable that maps to the database column myassets.ImageURL
		 * @var string strImageURL
		 */
		protected $strImageURL;
		const ImageURLDefault = null;


		/**
		 * Protected member variable that maps to the database column myassets.Author
		 * @var string strAuthor
		 */
		protected $strAuthor;
		const AuthorDefault = null;


		/**
		 * Protected member variable that maps to the database column myassets.NumberOfPages
		 * @var string strNumberOfPages
		 */
		protected $strNumberOfPages;
		const NumberOfPagesMaxLength = 255;
		const NumberOfPagesDefault = null;


		/**
		 * Protected member variable that maps to the database column myassets.Publisher
		 * @var string strPublisher
		 */
		protected $strPublisher;
		const PublisherMaxLength = 255;
		const PublisherDefault = null;


		/**
		 * Protected member variable that maps to the database column myassets.ISBN
		 * @var string strIsbn
		 */
		protected $strIsbn;
		const IsbnMaxLength = 20;
		const IsbnDefault = null;


		/**
		 * Protected member variable that maps to the database column myassets.Actor
		 * @var string strActor
		 */
		protected $strActor;
		const ActorDefault = null;


		/**
		 * Protected member variable that maps to the database column myassets.Director
		 * @var string strDirector
		 */
		protected $strDirector;
		const DirectorDefault = null;


		/**
		 * Protected member variable that maps to the database column myassets.RunningTime
		 * @var string strRunningTime
		 */
		protected $strRunningTime;
		const RunningTimeMaxLength = 5;
		const RunningTimeDefault = null;


		/**
		 * Protected member variable that maps to the database column myassets.Artist
		 * @var string strArtist
		 */
		protected $strArtist;
		const ArtistDefault = null;


		/**
		 * Protected member variable that maps to the database column myassets.Label
		 * @var string strLabel
		 */
		protected $strLabel;
		const LabelMaxLength = 255;
		const LabelDefault = null;


		/**
		 * Protected member variable that maps to the database column myassets.NumberOfDiscs
		 * @var string strNumberOfDiscs
		 */
		protected $strNumberOfDiscs;
		const NumberOfDiscsMaxLength = 3;
		const NumberOfDiscsDefault = null;


		/**
		 * Protected member variable that maps to the database column myassets.Tracks
		 * @var string strTracks
		 */
		protected $strTracks;
		const TracksDefault = null;


		/**
		 * Protected member variable that maps to the database column myassets.Language
		 * @var string strLanguage
		 */
		protected $strLanguage;
		const LanguageMaxLength = 20;
		const LanguageDefault = null;


		/**
		 * Protected member variable that maps to the database column myassets.Genre
		 * @var string strGenre
		 */
		protected $strGenre;
		const GenreMaxLength = 45;
		const GenreDefault = null;


		/**
		 * Protected member variable that maps to the database column myassets.Owner
		 * @var string strOwner
		 */
		protected $strOwner;
		const OwnerMaxLength = 10;
		const OwnerDefault = null;


		/**
		 * Protected array of virtual attributes for this object (e.g. extra/other calculated and/or non-object bound
		 * columns from the run-time database query result for this object).  Used by InstantiateDbRow and
		 * GetVirtualAttribute.
		 * @var string[] $__strVirtualAttributeArray
		 */
		protected $__strVirtualAttributeArray = array();

		/**
		 * Protected internal member variable that specifies whether or not this object is Restored from the database.
		 * Used by Save() to determine if Save() should perform a db UPDATE or INSERT.
		 * @var bool __blnRestored;
		 */
		protected $__blnRestored;




		///////////////////////////////
		// PROTECTED MEMBER OBJECTS
		///////////////////////////////





		///////////////////////////////
		// CLASS-WIDE LOAD AND COUNT METHODS
		///////////////////////////////

		/**
		 * Static method to retrieve the Database object that owns this class.
		 * @return QDatabaseBase reference to the Database object that can query this class
		 */
		public static function GetDatabase() {
			return QApplication::$Database[1];
		}

		/**
		 * Load a Myassets from PK Info
		 * @param integer $intId
		 * @return Myassets
		 */
		public static function Load($intId) {
			// Use QuerySingle to Perform the Query
			return Myassets::QuerySingle(
				QQ::Equal(QQN::Myassets()->Id, $intId)
			);
		}

		/**
		 * Load all Myassetses
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return Myassets[]
		 */
		public static function LoadAll($objOptionalClauses = null) {
			if (func_num_args() > 1) {
				throw new QCallerException("LoadAll must be called with an array of optional clauses as a single argument");
			}
			// Call Myassets::QueryArray to perform the LoadAll query
			try {
				return Myassets::QueryArray(QQ::All(), $objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count all Myassetses
		 * @return int
		 */
		public static function CountAll() {
			// Call Myassets::QueryCount to perform the CountAll query
			return Myassets::QueryCount(QQ::All());
		}




		///////////////////////////////
		// QCUBED QUERY-RELATED METHODS
		///////////////////////////////

		/**
		 * Internally called method to assist with calling Qcubed Query for this class
		 * on load methods.
		 * @param QQueryBuilder &$objQueryBuilder the QueryBuilder object that will be created
		 * @param QQCondition $objConditions any conditions on the query, itself
		 * @param QQClause[] $objOptionalClausees additional optional QQClause object or array of QQClause objects for this query
		 * @param mixed[] $mixParameterArray a array of name-value pairs to perform PrepareStatement with (sending in null will skip the PrepareStatement step)
		 * @param boolean $blnCountOnly only select a rowcount
		 * @return string the query statement
		 */
		protected static function BuildQueryStatement(&$objQueryBuilder, QQCondition $objConditions, $objOptionalClauses, $mixParameterArray, $blnCountOnly) {
			// Get the Database Object for this Class
			$objDatabase = Myassets::GetDatabase();

			// Create/Build out the QueryBuilder object with Myassets-specific SELET and FROM fields
			$objQueryBuilder = new QQueryBuilder($objDatabase, 'myassets');
			Myassets::GetSelectFields($objQueryBuilder);
			$objQueryBuilder->AddFromItem('myassets');

			// Set "CountOnly" option (if applicable)
			if ($blnCountOnly)
				$objQueryBuilder->SetCountOnlyFlag();

			// Apply Any Conditions
			if ($objConditions)
				try {
					$objConditions->UpdateQueryBuilder($objQueryBuilder);
				} catch (QCallerException $objExc) {
					$objExc->IncrementOffset();
					throw $objExc;
				}

			// Iterate through all the Optional Clauses (if any) and perform accordingly
			if ($objOptionalClauses) {
				if ($objOptionalClauses instanceof QQClause)
					$objOptionalClauses->UpdateQueryBuilder($objQueryBuilder);
				else if (is_array($objOptionalClauses))
					foreach ($objOptionalClauses as $objClause)
						$objClause->UpdateQueryBuilder($objQueryBuilder);
				else
					throw new QCallerException('Optional Clauses must be a QQClause object or an array of QQClause objects');
			}

			// Get the SQL Statement
			$strQuery = $objQueryBuilder->GetStatement();

			// Prepare the Statement with the Query Parameters (if applicable)
			if ($mixParameterArray) {
				if (is_array($mixParameterArray)) {
					if (count($mixParameterArray))
						$strQuery = $objDatabase->PrepareStatement($strQuery, $mixParameterArray);

					// Ensure that there are no other Unresolved Named Parameters
					if (strpos($strQuery, chr(QQNamedValue::DelimiterCode) . '{') !== false)
						throw new QCallerException('Unresolved named parameters in the query');
				} else
					throw new QCallerException('Parameter Array must be an array of name-value parameter pairs');
			}

			// Return the Objects
			return $strQuery;
		}

		/**
		 * Static Qcubed Query method to query for a single Myassets object.
		 * Uses BuildQueryStatment to perform most of the work.
		 * @param QQCondition $objConditions any conditions on the query, itself
		 * @param QQClause[] $objOptionalClausees additional optional QQClause objects for this query
		 * @param mixed[] $mixParameterArray a array of name-value pairs to perform PrepareStatement with
		 * @return Myassets the queried object
		 */
		public static function QuerySingle(QQCondition $objConditions, $objOptionalClauses = null, $mixParameterArray = null) {
			// Get the Query Statement
			try {
				$strQuery = Myassets::BuildQueryStatement($objQueryBuilder, $objConditions, $objOptionalClauses, $mixParameterArray, false);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
			
			// Perform the Query, Get the First Row, and Instantiate a new Myassets object
			$objDbResult = $objQueryBuilder->Database->Query($strQuery);
			
			// Do we have to expand anything?
			if ($objQueryBuilder->ExpandAsArrayNodes) {
				$objToReturn = array();
				while ($objDbRow = $objDbResult->GetNextRow()) {
					$objItem = Myassets::InstantiateDbRow($objDbRow, null, $objQueryBuilder->ExpandAsArrayNodes, $objToReturn, $objQueryBuilder->ColumnAliasArray);
					if ($objItem)
						$objToReturn[] = $objItem;					
				}			
				// Since we only want the object to return, lets return the object and not the array.
				return $objToReturn[0];
			} else {
				// No expands just return the first row
				$objToReturn = null;
				while ($objDbRow = $objDbResult->GetNextRow())
					$objToReturn = Myassets::InstantiateDbRow($objDbRow, null, null, null, $objQueryBuilder->ColumnAliasArray);
			}
			
			return $objToReturn;
		}

		/**
		 * Static Qcubed Query method to query for an array of Myassets objects.
		 * Uses BuildQueryStatment to perform most of the work.
		 * @param QQCondition $objConditions any conditions on the query, itself
		 * @param QQClause[] $objOptionalClausees additional optional QQClause objects for this query
		 * @param mixed[] $mixParameterArray a array of name-value pairs to perform PrepareStatement with
		 * @return Myassets[] the queried objects as an array
		 */
		public static function QueryArray(QQCondition $objConditions, $objOptionalClauses = null, $mixParameterArray = null) {
			// Get the Query Statement
			try {
				$strQuery = Myassets::BuildQueryStatement($objQueryBuilder, $objConditions, $objOptionalClauses, $mixParameterArray, false);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}

			// Perform the Query and Instantiate the Array Result
			$objDbResult = $objQueryBuilder->Database->Query($strQuery);
			return Myassets::InstantiateDbResult($objDbResult, $objQueryBuilder->ExpandAsArrayNodes, $objQueryBuilder->ColumnAliasArray);
		}

		/**
		 * Static Qcubed Query method to query for a count of Myassets objects.
		 * Uses BuildQueryStatment to perform most of the work.
		 * @param QQCondition $objConditions any conditions on the query, itself
		 * @param QQClause[] $objOptionalClausees additional optional QQClause objects for this query
		 * @param mixed[] $mixParameterArray a array of name-value pairs to perform PrepareStatement with
		 * @return integer the count of queried objects as an integer
		 */
		public static function QueryCount(QQCondition $objConditions, $objOptionalClauses = null, $mixParameterArray = null) {
			// Get the Query Statement
			try {
				$strQuery = Myassets::BuildQueryStatement($objQueryBuilder, $objConditions, $objOptionalClauses, $mixParameterArray, true);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}

			// Perform the Query and return the row_count
			$objDbResult = $objQueryBuilder->Database->Query($strQuery);

			// Figure out if the query is using GroupBy
			$blnGrouped = false;

			if ($objOptionalClauses) foreach ($objOptionalClauses as $objClause) {
				if ($objClause instanceof QQGroupBy) {
					$blnGrouped = true;
					break;
				}
			}

			if ($blnGrouped)
				// Groups in this query - return the count of Groups (which is the count of all rows)
				return $objDbResult->CountRows();
			else {
				// No Groups - return the sql-calculated count(*) value
				$strDbRow = $objDbResult->FetchRow();
				return QType::Cast($strDbRow[0], QType::Integer);
			}
		}

/*		public static function QueryArrayCached($strConditions, $mixParameterArray = null) {
			// Get the Database Object for this Class
			$objDatabase = Myassets::GetDatabase();

			// Lookup the QCache for This Query Statement
			$objCache = new QCache('query', 'myassets_' . serialize($strConditions));
			if (!($strQuery = $objCache->GetData())) {
				// Not Found -- Go ahead and Create/Build out a new QueryBuilder object with Myassets-specific fields
				$objQueryBuilder = new QQueryBuilder($objDatabase);
				Myassets::GetSelectFields($objQueryBuilder);
				Myassets::GetFromFields($objQueryBuilder);

				// Ensure the Passed-in Conditions is a string
				try {
					$strConditions = QType::Cast($strConditions, QType::String);
				} catch (QCallerException $objExc) {
					$objExc->IncrementOffset();
					throw $objExc;
				}

				// Create the Conditions object, and apply it
				$objConditions = eval('return ' . $strConditions . ';');

				// Apply Any Conditions
				if ($objConditions)
					$objConditions->UpdateQueryBuilder($objQueryBuilder);

				// Get the SQL Statement
				$strQuery = $objQueryBuilder->GetStatement();

				// Save the SQL Statement in the Cache
				$objCache->SaveData($strQuery);
			}

			// Prepare the Statement with the Parameters
			if ($mixParameterArray)
				$strQuery = $objDatabase->PrepareStatement($strQuery, $mixParameterArray);

			// Perform the Query and Instantiate the Array Result
			$objDbResult = $objDatabase->Query($strQuery);
			return Myassets::InstantiateDbResult($objDbResult);
		}*/

		/**
		 * Updates a QQueryBuilder with the SELECT fields for this Myassets
		 * @param QQueryBuilder $objBuilder the Query Builder object to update
		 * @param string $strPrefix optional prefix to add to the SELECT fields
		 */
		public static function GetSelectFields(QQueryBuilder $objBuilder, $strPrefix = null) {
			if ($strPrefix) {
				$strTableName = $strPrefix;
				$strAliasPrefix = $strPrefix . '__';
			} else {
				$strTableName = 'myassets';
				$strAliasPrefix = '';
			}

			$objBuilder->AddSelectItem($strTableName, 'id', $strAliasPrefix . 'id');
			$objBuilder->AddSelectItem($strTableName, 'ASIN', $strAliasPrefix . 'ASIN');
			$objBuilder->AddSelectItem($strTableName, 'DetailPageURL', $strAliasPrefix . 'DetailPageURL');
			$objBuilder->AddSelectItem($strTableName, 'Title', $strAliasPrefix . 'Title');
			$objBuilder->AddSelectItem($strTableName, 'ProductGroup', $strAliasPrefix . 'ProductGroup');
			$objBuilder->AddSelectItem($strTableName, 'ImageURL', $strAliasPrefix . 'ImageURL');
			$objBuilder->AddSelectItem($strTableName, 'Author', $strAliasPrefix . 'Author');
			$objBuilder->AddSelectItem($strTableName, 'NumberOfPages', $strAliasPrefix . 'NumberOfPages');
			$objBuilder->AddSelectItem($strTableName, 'Publisher', $strAliasPrefix . 'Publisher');
			$objBuilder->AddSelectItem($strTableName, 'ISBN', $strAliasPrefix . 'ISBN');
			$objBuilder->AddSelectItem($strTableName, 'Actor', $strAliasPrefix . 'Actor');
			$objBuilder->AddSelectItem($strTableName, 'Director', $strAliasPrefix . 'Director');
			$objBuilder->AddSelectItem($strTableName, 'RunningTime', $strAliasPrefix . 'RunningTime');
			$objBuilder->AddSelectItem($strTableName, 'Artist', $strAliasPrefix . 'Artist');
			$objBuilder->AddSelectItem($strTableName, 'Label', $strAliasPrefix . 'Label');
			$objBuilder->AddSelectItem($strTableName, 'NumberOfDiscs', $strAliasPrefix . 'NumberOfDiscs');
			$objBuilder->AddSelectItem($strTableName, 'Tracks', $strAliasPrefix . 'Tracks');
			$objBuilder->AddSelectItem($strTableName, 'Language', $strAliasPrefix . 'Language');
			$objBuilder->AddSelectItem($strTableName, 'Genre', $strAliasPrefix . 'Genre');
			$objBuilder->AddSelectItem($strTableName, 'Owner', $strAliasPrefix . 'Owner');
		}



		///////////////////////////////
		// INSTANTIATION-RELATED METHODS
		///////////////////////////////

		/**
		 * Instantiate a Myassets from a Database Row.
		 * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
		 * is calling this Myassets::InstantiateDbRow in order to perform
		 * early binding on referenced objects.
		 * @param DatabaseRowBase $objDbRow
		 * @param string $strAliasPrefix
		 * @param string $strExpandAsArrayNodes
		 * @param QBaseClass $arrPreviousItem
		 * @param string[] $strColumnAliasArray
		 * @return Myassets
		*/
		public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $arrPreviousItems = null, $strColumnAliasArray = array()) {
			// If blank row, return null
			if (!$objDbRow) {
				return null;
			}

			// Create a new instance of the Myassets object
			$objToReturn = new Myassets();
			$objToReturn->__blnRestored = true;

			$strAliasName = array_key_exists($strAliasPrefix . 'id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'id'] : $strAliasPrefix . 'id';
			$objToReturn->intId = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'ASIN', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'ASIN'] : $strAliasPrefix . 'ASIN';
			$objToReturn->strAsin = $objDbRow->GetColumn($strAliasName, 'VarChar');
			$strAliasName = array_key_exists($strAliasPrefix . 'DetailPageURL', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'DetailPageURL'] : $strAliasPrefix . 'DetailPageURL';
			$objToReturn->strDetailPageURL = $objDbRow->GetColumn($strAliasName, 'Blob');
			$strAliasName = array_key_exists($strAliasPrefix . 'Title', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'Title'] : $strAliasPrefix . 'Title';
			$objToReturn->strTitle = $objDbRow->GetColumn($strAliasName, 'Blob');
			$strAliasName = array_key_exists($strAliasPrefix . 'ProductGroup', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'ProductGroup'] : $strAliasPrefix . 'ProductGroup';
			$objToReturn->strProductGroup = $objDbRow->GetColumn($strAliasName, 'VarChar');
			$strAliasName = array_key_exists($strAliasPrefix . 'ImageURL', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'ImageURL'] : $strAliasPrefix . 'ImageURL';
			$objToReturn->strImageURL = $objDbRow->GetColumn($strAliasName, 'Blob');
			$strAliasName = array_key_exists($strAliasPrefix . 'Author', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'Author'] : $strAliasPrefix . 'Author';
			$objToReturn->strAuthor = $objDbRow->GetColumn($strAliasName, 'Blob');
			$strAliasName = array_key_exists($strAliasPrefix . 'NumberOfPages', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'NumberOfPages'] : $strAliasPrefix . 'NumberOfPages';
			$objToReturn->strNumberOfPages = $objDbRow->GetColumn($strAliasName, 'VarChar');
			$strAliasName = array_key_exists($strAliasPrefix . 'Publisher', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'Publisher'] : $strAliasPrefix . 'Publisher';
			$objToReturn->strPublisher = $objDbRow->GetColumn($strAliasName, 'VarChar');
			$strAliasName = array_key_exists($strAliasPrefix . 'ISBN', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'ISBN'] : $strAliasPrefix . 'ISBN';
			$objToReturn->strIsbn = $objDbRow->GetColumn($strAliasName, 'VarChar');
			$strAliasName = array_key_exists($strAliasPrefix . 'Actor', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'Actor'] : $strAliasPrefix . 'Actor';
			$objToReturn->strActor = $objDbRow->GetColumn($strAliasName, 'Blob');
			$strAliasName = array_key_exists($strAliasPrefix . 'Director', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'Director'] : $strAliasPrefix . 'Director';
			$objToReturn->strDirector = $objDbRow->GetColumn($strAliasName, 'Blob');
			$strAliasName = array_key_exists($strAliasPrefix . 'RunningTime', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'RunningTime'] : $strAliasPrefix . 'RunningTime';
			$objToReturn->strRunningTime = $objDbRow->GetColumn($strAliasName, 'VarChar');
			$strAliasName = array_key_exists($strAliasPrefix . 'Artist', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'Artist'] : $strAliasPrefix . 'Artist';
			$objToReturn->strArtist = $objDbRow->GetColumn($strAliasName, 'Blob');
			$strAliasName = array_key_exists($strAliasPrefix . 'Label', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'Label'] : $strAliasPrefix . 'Label';
			$objToReturn->strLabel = $objDbRow->GetColumn($strAliasName, 'VarChar');
			$strAliasName = array_key_exists($strAliasPrefix . 'NumberOfDiscs', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'NumberOfDiscs'] : $strAliasPrefix . 'NumberOfDiscs';
			$objToReturn->strNumberOfDiscs = $objDbRow->GetColumn($strAliasName, 'VarChar');
			$strAliasName = array_key_exists($strAliasPrefix . 'Tracks', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'Tracks'] : $strAliasPrefix . 'Tracks';
			$objToReturn->strTracks = $objDbRow->GetColumn($strAliasName, 'Blob');
			$strAliasName = array_key_exists($strAliasPrefix . 'Language', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'Language'] : $strAliasPrefix . 'Language';
			$objToReturn->strLanguage = $objDbRow->GetColumn($strAliasName, 'VarChar');
			$strAliasName = array_key_exists($strAliasPrefix . 'Genre', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'Genre'] : $strAliasPrefix . 'Genre';
			$objToReturn->strGenre = $objDbRow->GetColumn($strAliasName, 'VarChar');
			$strAliasName = array_key_exists($strAliasPrefix . 'Owner', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'Owner'] : $strAliasPrefix . 'Owner';
			$objToReturn->strOwner = $objDbRow->GetColumn($strAliasName, 'VarChar');

			if (isset($arrPreviousItems) && is_array($arrPreviousItems)) {
				foreach ($arrPreviousItems as $objPreviousItem) {
					if ($objToReturn->Id != $objPreviousItem->Id) {
						continue;
					}

					// complete match - all primary key columns are the same
					return null;
				}
			}

			// Instantiate Virtual Attributes
			foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
				$strVirtualPrefix = $strAliasPrefix . '__';
				$strVirtualPrefixLength = strlen($strVirtualPrefix);
				if (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix)
					$objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
			}

			// Prepare to Check for Early/Virtual Binding
			if (!$strAliasPrefix)
				$strAliasPrefix = 'myassets__';




			return $objToReturn;
		}

		/**
		 * Instantiate an array of Myassetses from a Database Result
		 * @param DatabaseResultBase $objDbResult
		 * @param string $strExpandAsArrayNodes
		 * @param string[] $strColumnAliasArray
		 * @return Myassets[]
		 */
		public static function InstantiateDbResult(QDatabaseResultBase $objDbResult, $strExpandAsArrayNodes = null, $strColumnAliasArray = null) {
			$objToReturn = array();
			
			if (!$strColumnAliasArray)
				$strColumnAliasArray = array();

			// If blank resultset, then return empty array
			if (!$objDbResult)
				return $objToReturn;

			// Load up the return array with each row
			if ($strExpandAsArrayNodes) {
				$objToReturn = array();
				while ($objDbRow = $objDbResult->GetNextRow()) {
					$objItem = Myassets::InstantiateDbRow($objDbRow, null, $strExpandAsArrayNodes, $objToReturn, $strColumnAliasArray);
					if ($objItem) {
						$objToReturn[] = $objItem;
					}
				}
			} else {
				while ($objDbRow = $objDbResult->GetNextRow())
					$objToReturn[] = Myassets::InstantiateDbRow($objDbRow, null, null, null, $strColumnAliasArray);
			}

			return $objToReturn;
		}



		///////////////////////////////////////////////////
		// INDEX-BASED LOAD METHODS (Single Load and Array)
		///////////////////////////////////////////////////
			
		/**
		 * Load a single Myassets object,
		 * by Id Index(es)
		 * @param integer $intId
		 * @return Myassets
		*/
		public static function LoadById($intId) {
			return Myassets::QuerySingle(
				QQ::Equal(QQN::Myassets()->Id, $intId)
			);
		}



		////////////////////////////////////////////////////
		// INDEX-BASED LOAD METHODS (Array via Many to Many)
		////////////////////////////////////////////////////




		//////////////////////////
		// SAVE, DELETE AND RELOAD
		//////////////////////////

		/**
		 * Save this Myassets
		 * @param bool $blnForceInsert
		 * @param bool $blnForceUpdate
		 * @return int
		 */
		public function Save($blnForceInsert = false, $blnForceUpdate = false) {
			// Get the Database Object for this Class
			$objDatabase = Myassets::GetDatabase();

			$mixToReturn = null;

			try {
				if ((!$this->__blnRestored) || ($blnForceInsert)) {
					// Perform an INSERT query
					$objDatabase->NonQuery('
						INSERT INTO `myassets` (
							`ASIN`,
							`DetailPageURL`,
							`Title`,
							`ProductGroup`,
							`ImageURL`,
							`Author`,
							`NumberOfPages`,
							`Publisher`,
							`ISBN`,
							`Actor`,
							`Director`,
							`RunningTime`,
							`Artist`,
							`Label`,
							`NumberOfDiscs`,
							`Tracks`,
							`Language`,
							`Genre`,
							`Owner`
						) VALUES (
							' . $objDatabase->SqlVariable($this->strAsin) . ',
							' . $objDatabase->SqlVariable($this->strDetailPageURL) . ',
							' . $objDatabase->SqlVariable($this->strTitle) . ',
							' . $objDatabase->SqlVariable($this->strProductGroup) . ',
							' . $objDatabase->SqlVariable($this->strImageURL) . ',
							' . $objDatabase->SqlVariable($this->strAuthor) . ',
							' . $objDatabase->SqlVariable($this->strNumberOfPages) . ',
							' . $objDatabase->SqlVariable($this->strPublisher) . ',
							' . $objDatabase->SqlVariable($this->strIsbn) . ',
							' . $objDatabase->SqlVariable($this->strActor) . ',
							' . $objDatabase->SqlVariable($this->strDirector) . ',
							' . $objDatabase->SqlVariable($this->strRunningTime) . ',
							' . $objDatabase->SqlVariable($this->strArtist) . ',
							' . $objDatabase->SqlVariable($this->strLabel) . ',
							' . $objDatabase->SqlVariable($this->strNumberOfDiscs) . ',
							' . $objDatabase->SqlVariable($this->strTracks) . ',
							' . $objDatabase->SqlVariable($this->strLanguage) . ',
							' . $objDatabase->SqlVariable($this->strGenre) . ',
							' . $objDatabase->SqlVariable($this->strOwner) . '
						)
					');

					// Update Identity column and return its value
					$mixToReturn = $this->intId = $objDatabase->InsertId('myassets', 'id');
				} else {
					// Perform an UPDATE query

					// First checking for Optimistic Locking constraints (if applicable)

					// Perform the UPDATE query
					$objDatabase->NonQuery('
						UPDATE
							`myassets`
						SET
							`ASIN` = ' . $objDatabase->SqlVariable($this->strAsin) . ',
							`DetailPageURL` = ' . $objDatabase->SqlVariable($this->strDetailPageURL) . ',
							`Title` = ' . $objDatabase->SqlVariable($this->strTitle) . ',
							`ProductGroup` = ' . $objDatabase->SqlVariable($this->strProductGroup) . ',
							`ImageURL` = ' . $objDatabase->SqlVariable($this->strImageURL) . ',
							`Author` = ' . $objDatabase->SqlVariable($this->strAuthor) . ',
							`NumberOfPages` = ' . $objDatabase->SqlVariable($this->strNumberOfPages) . ',
							`Publisher` = ' . $objDatabase->SqlVariable($this->strPublisher) . ',
							`ISBN` = ' . $objDatabase->SqlVariable($this->strIsbn) . ',
							`Actor` = ' . $objDatabase->SqlVariable($this->strActor) . ',
							`Director` = ' . $objDatabase->SqlVariable($this->strDirector) . ',
							`RunningTime` = ' . $objDatabase->SqlVariable($this->strRunningTime) . ',
							`Artist` = ' . $objDatabase->SqlVariable($this->strArtist) . ',
							`Label` = ' . $objDatabase->SqlVariable($this->strLabel) . ',
							`NumberOfDiscs` = ' . $objDatabase->SqlVariable($this->strNumberOfDiscs) . ',
							`Tracks` = ' . $objDatabase->SqlVariable($this->strTracks) . ',
							`Language` = ' . $objDatabase->SqlVariable($this->strLanguage) . ',
							`Genre` = ' . $objDatabase->SqlVariable($this->strGenre) . ',
							`Owner` = ' . $objDatabase->SqlVariable($this->strOwner) . '
						WHERE
							`id` = ' . $objDatabase->SqlVariable($this->intId) . '
					');
				}

			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}

			// Update __blnRestored and any Non-Identity PK Columns (if applicable)
			$this->__blnRestored = true;


			// Return 
			return $mixToReturn;
		}

		/**
		 * Delete this Myassets
		 * @return void
		 */
		public function Delete() {
			if ((is_null($this->intId)))
				throw new QUndefinedPrimaryKeyException('Cannot delete this Myassets with an unset primary key.');

			// Get the Database Object for this Class
			$objDatabase = Myassets::GetDatabase();


			// Perform the SQL Query
			$objDatabase->NonQuery('
				DELETE FROM
					`myassets`
				WHERE
					`id` = ' . $objDatabase->SqlVariable($this->intId) . '');
		}

		/**
		 * Delete all Myassetses
		 * @return void
		 */
		public static function DeleteAll() {
			// Get the Database Object for this Class
			$objDatabase = Myassets::GetDatabase();

			// Perform the Query
			$objDatabase->NonQuery('
				DELETE FROM
					`myassets`');
		}

		/**
		 * Truncate myassets table
		 * @return void
		 */
		public static function Truncate() {
			// Get the Database Object for this Class
			$objDatabase = Myassets::GetDatabase();

			// Perform the Query
			$objDatabase->NonQuery('
				TRUNCATE `myassets`');
		}

		/**
		 * Reload this Myassets from the database.
		 * @return void
		 */
		public function Reload() {
			// Make sure we are actually Restored from the database
			if (!$this->__blnRestored)
				throw new QCallerException('Cannot call Reload() on a new, unsaved Myassets object.');

			// Reload the Object
			$objReloaded = Myassets::Load($this->intId);

			// Update $this's local variables to match
			$this->strAsin = $objReloaded->strAsin;
			$this->strDetailPageURL = $objReloaded->strDetailPageURL;
			$this->strTitle = $objReloaded->strTitle;
			$this->strProductGroup = $objReloaded->strProductGroup;
			$this->strImageURL = $objReloaded->strImageURL;
			$this->strAuthor = $objReloaded->strAuthor;
			$this->strNumberOfPages = $objReloaded->strNumberOfPages;
			$this->strPublisher = $objReloaded->strPublisher;
			$this->strIsbn = $objReloaded->strIsbn;
			$this->strActor = $objReloaded->strActor;
			$this->strDirector = $objReloaded->strDirector;
			$this->strRunningTime = $objReloaded->strRunningTime;
			$this->strArtist = $objReloaded->strArtist;
			$this->strLabel = $objReloaded->strLabel;
			$this->strNumberOfDiscs = $objReloaded->strNumberOfDiscs;
			$this->strTracks = $objReloaded->strTracks;
			$this->strLanguage = $objReloaded->strLanguage;
			$this->strGenre = $objReloaded->strGenre;
			$this->strOwner = $objReloaded->strOwner;
		}



		////////////////////
		// PUBLIC OVERRIDERS
		////////////////////

				/**
		 * Override method to perform a property "Get"
		 * This will get the value of $strName
		 *
		 * @param string $strName Name of the property to get
		 * @return mixed
		 */
		public function __get($strName) {
			switch ($strName) {
				///////////////////
				// Member Variables
				///////////////////
				case 'Id':
					/**
					 * Gets the value for intId (Read-Only PK)
					 * @return integer
					 */
					return $this->intId;

				case 'Asin':
					/**
					 * Gets the value for strAsin (Not Null)
					 * @return string
					 */
					return $this->strAsin;

				case 'DetailPageURL':
					/**
					 * Gets the value for strDetailPageURL 
					 * @return string
					 */
					return $this->strDetailPageURL;

				case 'Title':
					/**
					 * Gets the value for strTitle 
					 * @return string
					 */
					return $this->strTitle;

				case 'ProductGroup':
					/**
					 * Gets the value for strProductGroup 
					 * @return string
					 */
					return $this->strProductGroup;

				case 'ImageURL':
					/**
					 * Gets the value for strImageURL 
					 * @return string
					 */
					return $this->strImageURL;

				case 'Author':
					/**
					 * Gets the value for strAuthor 
					 * @return string
					 */
					return $this->strAuthor;

				case 'NumberOfPages':
					/**
					 * Gets the value for strNumberOfPages 
					 * @return string
					 */
					return $this->strNumberOfPages;

				case 'Publisher':
					/**
					 * Gets the value for strPublisher 
					 * @return string
					 */
					return $this->strPublisher;

				case 'Isbn':
					/**
					 * Gets the value for strIsbn 
					 * @return string
					 */
					return $this->strIsbn;

				case 'Actor':
					/**
					 * Gets the value for strActor 
					 * @return string
					 */
					return $this->strActor;

				case 'Director':
					/**
					 * Gets the value for strDirector 
					 * @return string
					 */
					return $this->strDirector;

				case 'RunningTime':
					/**
					 * Gets the value for strRunningTime 
					 * @return string
					 */
					return $this->strRunningTime;

				case 'Artist':
					/**
					 * Gets the value for strArtist 
					 * @return string
					 */
					return $this->strArtist;

				case 'Label':
					/**
					 * Gets the value for strLabel 
					 * @return string
					 */
					return $this->strLabel;

				case 'NumberOfDiscs':
					/**
					 * Gets the value for strNumberOfDiscs 
					 * @return string
					 */
					return $this->strNumberOfDiscs;

				case 'Tracks':
					/**
					 * Gets the value for strTracks 
					 * @return string
					 */
					return $this->strTracks;

				case 'Language':
					/**
					 * Gets the value for strLanguage 
					 * @return string
					 */
					return $this->strLanguage;

				case 'Genre':
					/**
					 * Gets the value for strGenre 
					 * @return string
					 */
					return $this->strGenre;

				case 'Owner':
					/**
					 * Gets the value for strOwner 
					 * @return string
					 */
					return $this->strOwner;


				///////////////////
				// Member Objects
				///////////////////

				////////////////////////////
				// Virtual Object References (Many to Many and Reverse References)
				// (If restored via a "Many-to" expansion)
				////////////////////////////


				case '__Restored':
					return $this->__blnRestored;

				default:
					try {
						return parent::__get($strName);
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}
			}
		}

				/**
		 * Override method to perform a property "Set"
		 * This will set the property $strName to be $mixValue
		 *
		 * @param string $strName Name of the property to set
		 * @param string $mixValue New value of the property
		 * @return mixed
		 */
		public function __set($strName, $mixValue) {
			switch ($strName) {
				///////////////////
				// Member Variables
				///////////////////
				case 'Asin':
					/**
					 * Sets the value for strAsin (Not Null)
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strAsin = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'DetailPageURL':
					/**
					 * Sets the value for strDetailPageURL 
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strDetailPageURL = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'Title':
					/**
					 * Sets the value for strTitle 
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strTitle = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'ProductGroup':
					/**
					 * Sets the value for strProductGroup 
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strProductGroup = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'ImageURL':
					/**
					 * Sets the value for strImageURL 
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strImageURL = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'Author':
					/**
					 * Sets the value for strAuthor 
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strAuthor = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'NumberOfPages':
					/**
					 * Sets the value for strNumberOfPages 
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strNumberOfPages = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'Publisher':
					/**
					 * Sets the value for strPublisher 
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strPublisher = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'Isbn':
					/**
					 * Sets the value for strIsbn 
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strIsbn = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'Actor':
					/**
					 * Sets the value for strActor 
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strActor = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'Director':
					/**
					 * Sets the value for strDirector 
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strDirector = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'RunningTime':
					/**
					 * Sets the value for strRunningTime 
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strRunningTime = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'Artist':
					/**
					 * Sets the value for strArtist 
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strArtist = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'Label':
					/**
					 * Sets the value for strLabel 
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strLabel = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'NumberOfDiscs':
					/**
					 * Sets the value for strNumberOfDiscs 
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strNumberOfDiscs = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'Tracks':
					/**
					 * Sets the value for strTracks 
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strTracks = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'Language':
					/**
					 * Sets the value for strLanguage 
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strLanguage = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'Genre':
					/**
					 * Sets the value for strGenre 
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strGenre = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'Owner':
					/**
					 * Sets the value for strOwner 
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strOwner = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}


				///////////////////
				// Member Objects
				///////////////////
				default:
					try {
						return parent::__set($strName, $mixValue);
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}
			}
		}

		/**
		 * Lookup a VirtualAttribute value (if applicable).  Returns NULL if none found.
		 * @param string $strName
		 * @return string
		 */
		public function GetVirtualAttribute($strName) {
			if (array_key_exists($strName, $this->__strVirtualAttributeArray))
				return $this->__strVirtualAttributeArray[$strName];
			return null;
		}



		///////////////////////////////
		// ASSOCIATED OBJECTS' METHODS
		///////////////////////////////





		////////////////////////////////////////
		// METHODS for SOAP-BASED WEB SERVICES
		////////////////////////////////////////

		public static function GetSoapComplexTypeXml() {
			$strToReturn = '<complexType name="Myassets"><sequence>';
			$strToReturn .= '<element name="Id" type="xsd:int"/>';
			$strToReturn .= '<element name="Asin" type="xsd:string"/>';
			$strToReturn .= '<element name="DetailPageURL" type="xsd:string"/>';
			$strToReturn .= '<element name="Title" type="xsd:string"/>';
			$strToReturn .= '<element name="ProductGroup" type="xsd:string"/>';
			$strToReturn .= '<element name="ImageURL" type="xsd:string"/>';
			$strToReturn .= '<element name="Author" type="xsd:string"/>';
			$strToReturn .= '<element name="NumberOfPages" type="xsd:string"/>';
			$strToReturn .= '<element name="Publisher" type="xsd:string"/>';
			$strToReturn .= '<element name="Isbn" type="xsd:string"/>';
			$strToReturn .= '<element name="Actor" type="xsd:string"/>';
			$strToReturn .= '<element name="Director" type="xsd:string"/>';
			$strToReturn .= '<element name="RunningTime" type="xsd:string"/>';
			$strToReturn .= '<element name="Artist" type="xsd:string"/>';
			$strToReturn .= '<element name="Label" type="xsd:string"/>';
			$strToReturn .= '<element name="NumberOfDiscs" type="xsd:string"/>';
			$strToReturn .= '<element name="Tracks" type="xsd:string"/>';
			$strToReturn .= '<element name="Language" type="xsd:string"/>';
			$strToReturn .= '<element name="Genre" type="xsd:string"/>';
			$strToReturn .= '<element name="Owner" type="xsd:string"/>';
			$strToReturn .= '<element name="__blnRestored" type="xsd:boolean"/>';
			$strToReturn .= '</sequence></complexType>';
			return $strToReturn;
		}

		public static function AlterSoapComplexTypeArray(&$strComplexTypeArray) {
			if (!array_key_exists('Myassets', $strComplexTypeArray)) {
				$strComplexTypeArray['Myassets'] = Myassets::GetSoapComplexTypeXml();
			}
		}

		public static function GetArrayFromSoapArray($objSoapArray) {
			$objArrayToReturn = array();

			foreach ($objSoapArray as $objSoapObject)
				array_push($objArrayToReturn, Myassets::GetObjectFromSoapObject($objSoapObject));

			return $objArrayToReturn;
		}

		public static function GetObjectFromSoapObject($objSoapObject) {
			$objToReturn = new Myassets();
			if (property_exists($objSoapObject, 'Id'))
				$objToReturn->intId = $objSoapObject->Id;
			if (property_exists($objSoapObject, 'Asin'))
				$objToReturn->strAsin = $objSoapObject->Asin;
			if (property_exists($objSoapObject, 'DetailPageURL'))
				$objToReturn->strDetailPageURL = $objSoapObject->DetailPageURL;
			if (property_exists($objSoapObject, 'Title'))
				$objToReturn->strTitle = $objSoapObject->Title;
			if (property_exists($objSoapObject, 'ProductGroup'))
				$objToReturn->strProductGroup = $objSoapObject->ProductGroup;
			if (property_exists($objSoapObject, 'ImageURL'))
				$objToReturn->strImageURL = $objSoapObject->ImageURL;
			if (property_exists($objSoapObject, 'Author'))
				$objToReturn->strAuthor = $objSoapObject->Author;
			if (property_exists($objSoapObject, 'NumberOfPages'))
				$objToReturn->strNumberOfPages = $objSoapObject->NumberOfPages;
			if (property_exists($objSoapObject, 'Publisher'))
				$objToReturn->strPublisher = $objSoapObject->Publisher;
			if (property_exists($objSoapObject, 'Isbn'))
				$objToReturn->strIsbn = $objSoapObject->Isbn;
			if (property_exists($objSoapObject, 'Actor'))
				$objToReturn->strActor = $objSoapObject->Actor;
			if (property_exists($objSoapObject, 'Director'))
				$objToReturn->strDirector = $objSoapObject->Director;
			if (property_exists($objSoapObject, 'RunningTime'))
				$objToReturn->strRunningTime = $objSoapObject->RunningTime;
			if (property_exists($objSoapObject, 'Artist'))
				$objToReturn->strArtist = $objSoapObject->Artist;
			if (property_exists($objSoapObject, 'Label'))
				$objToReturn->strLabel = $objSoapObject->Label;
			if (property_exists($objSoapObject, 'NumberOfDiscs'))
				$objToReturn->strNumberOfDiscs = $objSoapObject->NumberOfDiscs;
			if (property_exists($objSoapObject, 'Tracks'))
				$objToReturn->strTracks = $objSoapObject->Tracks;
			if (property_exists($objSoapObject, 'Language'))
				$objToReturn->strLanguage = $objSoapObject->Language;
			if (property_exists($objSoapObject, 'Genre'))
				$objToReturn->strGenre = $objSoapObject->Genre;
			if (property_exists($objSoapObject, 'Owner'))
				$objToReturn->strOwner = $objSoapObject->Owner;
			if (property_exists($objSoapObject, '__blnRestored'))
				$objToReturn->__blnRestored = $objSoapObject->__blnRestored;
			return $objToReturn;
		}

		public static function GetSoapArrayFromArray($objArray) {
			if (!$objArray)
				return null;

			$objArrayToReturn = array();

			foreach ($objArray as $objObject)
				array_push($objArrayToReturn, Myassets::GetSoapObjectFromObject($objObject, true));

			return unserialize(serialize($objArrayToReturn));
		}

		public static function GetSoapObjectFromObject($objObject, $blnBindRelatedObjects) {
			return $objObject;
		}




	}



	/////////////////////////////////////
	// ADDITIONAL CLASSES for QCubed QUERY
	/////////////////////////////////////

	class QQNodeMyassets extends QQNode {
		protected $strTableName = 'myassets';
		protected $strPrimaryKey = 'id';
		protected $strClassName = 'Myassets';
		public function __get($strName) {
			switch ($strName) {
				case 'Id':
					return new QQNode('id', 'Id', 'integer', $this);
				case 'Asin':
					return new QQNode('ASIN', 'Asin', 'string', $this);
				case 'DetailPageURL':
					return new QQNode('DetailPageURL', 'DetailPageURL', 'string', $this);
				case 'Title':
					return new QQNode('Title', 'Title', 'string', $this);
				case 'ProductGroup':
					return new QQNode('ProductGroup', 'ProductGroup', 'string', $this);
				case 'ImageURL':
					return new QQNode('ImageURL', 'ImageURL', 'string', $this);
				case 'Author':
					return new QQNode('Author', 'Author', 'string', $this);
				case 'NumberOfPages':
					return new QQNode('NumberOfPages', 'NumberOfPages', 'string', $this);
				case 'Publisher':
					return new QQNode('Publisher', 'Publisher', 'string', $this);
				case 'Isbn':
					return new QQNode('ISBN', 'Isbn', 'string', $this);
				case 'Actor':
					return new QQNode('Actor', 'Actor', 'string', $this);
				case 'Director':
					return new QQNode('Director', 'Director', 'string', $this);
				case 'RunningTime':
					return new QQNode('RunningTime', 'RunningTime', 'string', $this);
				case 'Artist':
					return new QQNode('Artist', 'Artist', 'string', $this);
				case 'Label':
					return new QQNode('Label', 'Label', 'string', $this);
				case 'NumberOfDiscs':
					return new QQNode('NumberOfDiscs', 'NumberOfDiscs', 'string', $this);
				case 'Tracks':
					return new QQNode('Tracks', 'Tracks', 'string', $this);
				case 'Language':
					return new QQNode('Language', 'Language', 'string', $this);
				case 'Genre':
					return new QQNode('Genre', 'Genre', 'string', $this);
				case 'Owner':
					return new QQNode('Owner', 'Owner', 'string', $this);

				case '_PrimaryKeyNode':
					return new QQNode('id', 'Id', 'integer', $this);
				default:
					try {
						return parent::__get($strName);
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}
			}
		}
	}

	class QQReverseReferenceNodeMyassets extends QQReverseReferenceNode {
		protected $strTableName = 'myassets';
		protected $strPrimaryKey = 'id';
		protected $strClassName = 'Myassets';
		public function __get($strName) {
			switch ($strName) {
				case 'Id':
					return new QQNode('id', 'Id', 'integer', $this);
				case 'Asin':
					return new QQNode('ASIN', 'Asin', 'string', $this);
				case 'DetailPageURL':
					return new QQNode('DetailPageURL', 'DetailPageURL', 'string', $this);
				case 'Title':
					return new QQNode('Title', 'Title', 'string', $this);
				case 'ProductGroup':
					return new QQNode('ProductGroup', 'ProductGroup', 'string', $this);
				case 'ImageURL':
					return new QQNode('ImageURL', 'ImageURL', 'string', $this);
				case 'Author':
					return new QQNode('Author', 'Author', 'string', $this);
				case 'NumberOfPages':
					return new QQNode('NumberOfPages', 'NumberOfPages', 'string', $this);
				case 'Publisher':
					return new QQNode('Publisher', 'Publisher', 'string', $this);
				case 'Isbn':
					return new QQNode('ISBN', 'Isbn', 'string', $this);
				case 'Actor':
					return new QQNode('Actor', 'Actor', 'string', $this);
				case 'Director':
					return new QQNode('Director', 'Director', 'string', $this);
				case 'RunningTime':
					return new QQNode('RunningTime', 'RunningTime', 'string', $this);
				case 'Artist':
					return new QQNode('Artist', 'Artist', 'string', $this);
				case 'Label':
					return new QQNode('Label', 'Label', 'string', $this);
				case 'NumberOfDiscs':
					return new QQNode('NumberOfDiscs', 'NumberOfDiscs', 'string', $this);
				case 'Tracks':
					return new QQNode('Tracks', 'Tracks', 'string', $this);
				case 'Language':
					return new QQNode('Language', 'Language', 'string', $this);
				case 'Genre':
					return new QQNode('Genre', 'Genre', 'string', $this);
				case 'Owner':
					return new QQNode('Owner', 'Owner', 'string', $this);

				case '_PrimaryKeyNode':
					return new QQNode('id', 'Id', 'integer', $this);
				default:
					try {
						return parent::__get($strName);
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}
			}
		}
	}

?>